package buffered;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;

public class BufferedReaderTest4 {
    public static void main(String[] args) throws IOException {
        ArrayList<String> list=new ArrayList<>();
        BufferedReader br=new BufferedReader(new FileReader("G:\\Javatest2\\buffered\\chushibiao.txt"));
        String line;
        while((line=br.readLine())!=null){
//            对于非空行，才存入到数组list
            if(line.length()>0){
                list.add(line);
            }

        }
        br.close();
        for (String string : list) {
            System.out.println(string);

        }
    }
}
